SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwlrelfamiliaralumno
AS
SELECT     dbo.tb_relfamiliaralumno.idrelfamiliaralumno AS id, dbo.tb_relfamiliaralumno.idrelfamiliaralumno, dbo.tb_Parentezcos.Descripcion AS Parentezco, 
                      dbo.vwrAlumnos.Descripcion AS Alumno, dbo.vwrfamilia.Descripcion AS Familia
FROM         dbo.tb_relfamiliaralumno INNER JOIN
                      dbo.tb_Parentezcos ON dbo.tb_relfamiliaralumno.parentezco = dbo.tb_Parentezcos.idParentezco INNER JOIN
                      dbo.vwrAlumnos ON dbo.tb_relfamiliaralumno.alumno = dbo.vwrAlumnos.ID INNER JOIN
                      dbo.vwrfamilia ON dbo.tb_relfamiliaralumno.familiar = dbo.vwrfamilia.ID
GO
GRANT SELECT ON  [dbo].[vwlrelfamiliaralumno] TO [Alumnos]
GO
